#include "star_recognition.h"

#include <QtGui>
#include <QApplication>
#include <vector>
#include <fstream>
#include <iostream>

using namespace std;
int num_of_stars = 9100;
vector<int> marked;
vector<Star> stars;
int main(int argc, char *argv[])
{
	ifstream in_marked("marked");
	int num_of_marked;
	in_marked >> num_of_marked;
	marked.reserve(num_of_marked);
	for (int i = 0; i < num_of_marked; i++)
	{
		int tmp;
		in_marked >> tmp;
		marked .push_back(tmp);
	}

	ifstream in("catalog");
	for (int i = 0; i < 9100; i++)
	{
		char entry[198];
		in.getline(entry, 198);
		stars.push_back(Star(entry, marked));
//		if (stars.back().magn > 5) {
//			stars.pop_back();
//		}
	}

	QApplication a(argc, argv);
	star_recognition w;
	cout << stars.size();
	w.set_stars(stars);
	w.show();
	return a.exec();
}
